package com.word.app.config.token;

import java.io.IOException;

import javax.servlet.http.HttpServletResponse;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.word.app.controller.response.BaseResponse;
import com.word.app.controller.response.Code;



public class JWTErrorResp {
    public static void restError(HttpServletResponse response) {
        try {
            BaseResponse apiRest = new BaseResponse(Code.C401);
            response.setCharacterEncoding("UTF-8");
            response.setContentType("application/json");
            ObjectMapper mapper = new ObjectMapper();
            response.getWriter().write(mapper.writeValueAsString(apiRest));
            response.getWriter().close();

        }catch (IOException e){

        }
    }
}
